package Work;

import java.util.Random;
import java.util.Scanner;

/**
 * @Author: lu
 * @Date: 2021/8/8 19:50
 * @Description:
 */
public class Task04 {
    public static void main(String[] args) {
        //1.键盘录入班级人数
        System.out.println("请输入班级人数：");
        Scanner sc = new Scanner(System.in);
        int classNum = sc.nextInt();
        //2.根据录入的班级人数创建数组
        int[] classGrade = new int[classNum];
        Random random = new Random();
        int count = 0,total = 0;
        for(int i=0;i<classGrade.length;i++){
            classGrade[i] = random.nextInt(100);
            total += classGrade[i];
            if(classGrade[i]<60){
                count++;
            }
        }
        System.out.println("不及格人数："+ count);
        System.out.println("班级平均分："+ total/classNum);
    }
}
